package com.finley.flowabledemo.design.state.demo02.state;


import com.finley.flowabledemo.design.state.demo02.source.DatabaseConnection2;
import com.finley.flowabledemo.design.state.demo02.source.EmailSender;
import com.finley.flowabledemo.design.state.demo02.source.Order;

/**
 * @description:
 * @author: xianfei.chao
 * @date 2025/6/24 17:18
 * @version: 1.0
 */
public class OrderStatusContext {


    /**
     * new DatabaseConnection2( "jdbc：mysql：//localhost/shop",  "root",  "password");
     */
    private DatabaseConnection2 conn;

    private Order order;

    private EmailSender emailSender;

    private OrderStatusState orderStatusState;

    public void execHandler(){
        this.orderStatusState.handle(this);
    }

    public OrderStatusState getOrderStatusState() {
        return orderStatusState;
    }

    public void setOrderStatusState(OrderStatusState orderStatusState) {
        this.orderStatusState = orderStatusState;
    }

    public Order getOrder() {
        return order;
    }

    public void setOrder(Order order) {
        this.order = order;
    }

    public DatabaseConnection2 getConn() {
        return conn;
    }

    public void setConn(DatabaseConnection2 conn) {
        this.conn = conn;
    }

    public EmailSender getEmailSender() {
        return emailSender;
    }

    public void setEmailSender(EmailSender emailSender) {
        this.emailSender = emailSender;
    }
}
